package com.wx.cloud.daily.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Page<T> {

    private Integer pageNum; // 当前页
    private Integer pageSize;// 每页显示条数
    private Integer total;// 总条数

    private List<T> list;

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public Integer getStartSize() { // 获取从第几条数据开始读取
        return (pageNum - 1) * pageSize;
    }

}
